﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using SH.STD.Model;
using SH.STD.DataProvider;

namespace SH.STD.Web
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.SetTab(TabType.Index);

            var sql = "select * from project order by LastModified desc";
            var dt = Cmn.DB.getDataTable(sql);

            this.rptLastestProjects.DataSource = dt;
            this.rptLastestProjects.DataBind();
            this.lblCnt1.Text = dt.Rows.Count.ToString();

            sql = "select * from project where DATEDIFF(day, enddate, getdate()) >90 order by LastModified desc";
            dt = Cmn.DB.getDataTable(sql);

            this.rptProjectsRemind.DataSource = dt;
            this.rptProjectsRemind.DataBind();

            this.lblCnt2.Text = dt.Rows.Count.ToString();
        }
    }
}